package top.yxqz.resp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author Mr.余
 * @date 2022/11/18
 * @package top.yxqz.resp
 */
@WebServlet("/demo7")
public class ResDemo7 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        InputStream resourceAsStream = ResDemo7.class.getClassLoader().getResourceAsStream("C:\\Users\\Y\\Desktop\\1.png");
        String path = "C:\\Users\\Y\\Desktop\\1.png";
        resp.getWriter().println(resourceAsStream);
    }
}
